package com.fuqi.android.zhongcai.business.shuig.view.activity;

import android.os.Bundle;

import com.fuqi.android.zhongcai.R;
import com.fuqi.android.zhongcai.business.shuig.view.fragment.ShuiGFragment;
import com.fuqi.android.zhongcai.business.shuig.mvp.ShuiGPresenter;
import com.fuqi.android.zhongcai.base.view.activity.BaseActivity;
import com.fuqi.android.zhongcai.utils.ActivityUtils;
import com.fuqi.android.zhongcai.utils.LogUtils;

/**
 * Created by Bruce on 2016/10/20.
 */
public class ShuiGActivity extends BaseActivity {
    ShuiGFragment shuiGFragment;
    String ordid;
    String ordtype;
    @Override
    public void initView() {
        shuiGFragment =(ShuiGFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame);

        ordid = getIntent().getStringExtra("order_id");
        ordtype = getIntent().getStringExtra("order_type");

        if (shuiGFragment == null) {
            shuiGFragment = ShuiGFragment.newInstance();

            if (getIntent().hasExtra("order_id")) {
                Bundle bundle = new Bundle();
                bundle.putString("order_id", ordid);
                bundle.putString("order_type", ordtype);
                shuiGFragment.setArguments(bundle);
            } else {
            }

            ActivityUtils.addFragmentToActivity(getSupportFragmentManager(),
                    shuiGFragment, R.id.contentFrame);
        }

    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {
/*
 * 测试git push
 * test
 */
        titleBar.setTitle("订单详情");
        LogUtils.i("order_id: " + getIntent().getStringExtra("order_id"));
        ordid = getIntent().getStringExtra("order_id");
        // Create the presenter
        new ShuiGPresenter(
                ordid,
                shuiGFragment);
    }



    @Override
    public boolean hasTitleBar() {
        return true;
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_shuiguan_details;
    }
}
